package com.ecas.code.generator.service.chain;

import com.ecas.code.generator.dto.ParamterDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;
import java.util.Properties;
import java.util.zip.ZipOutputStream;

public abstract  class GeneratorHandler {
    private static final Logger log = LoggerFactory.getLogger(GeneratorHandler.class);

    private GeneratorHandler next;
    private static Properties properties;
    private static  Map<String,Object> templateData;
    private static ZipOutputStream zipOutputStream;

    public void setGeneratorHandler(GeneratorHandler next) {
        this.next = next;
    }

    public  void handleGenerate(ParamterDTO paramterDTO){
        if (paramterDTO != null && next != null) {
            next.handleGenerate(paramterDTO);
        }
    }

    public abstract void process(ParamterDTO paramterDTO);

    public void setProperties(Properties properties) {
        this.properties = properties;
    }

    public void setTemplateData(Map<String, Object> templateData) {
        this.templateData = templateData;
    }


    public Properties getProperties() {
        return properties;
    }

    public Map<String, Object> getTemplateData() {
        return templateData;
    }

    public ZipOutputStream getZipOutputStream() {
        return zipOutputStream;
    }

    public void setZipOutputStream(ZipOutputStream zipOutputStream) {
        this.zipOutputStream = zipOutputStream;
    }
}
